package com.codechenxi.study.config;

import dev.langchain4j.model.chat.ChatModel;
import dev.langchain4j.model.openai.OpenAiChatModel;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author codechenxi
 * @description 知识出处 https://docs.langchain4j.dev/get-started
 * @since 2025/7/2 17:48
 */

@Configuration
public class LLMConfig {

    @Bean
    public ChatModel chatModelQwen(){

        return OpenAiChatModel.builder()
                .apiKey(System.getenv("DASHSCOPE_API_KEY"))
                .modelName("qwen-plus")
                .baseUrl("https://dashscope.aliyuncs.com/compatible-mode/v1")
                .build();
    }
}
